﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TB.DALSqlProvider
{
    public class DALSqlFactory : TB.DALFactory.DALFactory
    {
        public override TB.IDAL.IDALDianpu DALDianpuProvider
        {
            get
            {
                DALSqlProvider.DianpuDALSqlProvider obj = System.Web.HttpContext.Current.Cache.Get("TB.IDAL.IDALDianpu") as DALSqlProvider.DianpuDALSqlProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.DianpuDALSqlProvider();

                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALDianpu", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override IDAL.IDALusername DALUserNameProvider
        {
            get
            {
                DALSqlProvider.usernameSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("TB.IDAL.IDALUsername") as DALSqlProvider.usernameSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.usernameSqlDALProvider();

                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALUsername", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override IDAL.IDALVisitLog DALVisitLogProvider
        {
            get
            {
                DALSqlProvider.VisitLogSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("TB.IDAL.IDALVistiLog") as DALSqlProvider.VisitLogSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.VisitLogSqlDALProvider();

                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALVistiLog", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override IDAL.IDALDesinger DALDesingerProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.DesingerSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALDesinger") as DALSqlProvider.DesingerSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.DesingerSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALDesinger", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
        public override IDAL.IDALTemplate DALTemplateProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.TemplateSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALTemplate") as DALSqlProvider.TemplateSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.TemplateSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALTemplate", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override IDAL.IDALMpReqMsg DALMpReqMsgProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.MpReqMsgSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALMpReqMsg") as DALSqlProvider.MpReqMsgSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.MpReqMsgSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALMpReqMsg", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
        public override IDAL.IDALMpRespMsg DALMpRespMsgProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.MpRespMsgSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALMpRespMsg") as DALSqlProvider.MpRespMsgSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.MpRespMsgSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALMpRespMsg", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
        public override IDAL.IDALMpUserInfo DALMpUserInfoProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.MpUserInfoSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALMpUserInfo") as DALSqlProvider.MpUserInfoSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.MpUserInfoSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALMpUserInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override IDAL.IDALMpRespMsgUser DALMpRespMsgUserProvider
        {
            get
            {
                //TODO:效率考虑,可考虑使用缓存
                DALSqlProvider.MpRespMsgUserSqlDALProvider obj = System.Web.HttpContext.Current.Cache.Get("OA.IDAL.IDALMpRespMsgUser") as DALSqlProvider.MpRespMsgUserSqlDALProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.MpRespMsgUserSqlDALProvider();
                    System.Web.HttpContext.Current.Cache.Add("TB.IDAL.IDALMpRespMsgUser", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
    }
}
